<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>时光桥梁后台管理系统</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<%--<link rel="shortcut icon" href="${pageContext.request.contextPath}/font/favicon.ico" type="image/x-icon"/>--%>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main/font.css">
		<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/main/xadmin.css">
		<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/swiper.min.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/login/jquery.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/swiper.jquery.min.js"></script>
		<script src="${pageContext.request.contextPath}/static/lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/main/xadmin.js"></script>

	</head>
	<body>
		<!-- 顶部开始 -->
		<div class="container">
			<jsp:include page="header.jsp"/>
		</div>
		<!-- 顶部结束 -->
		<!-- 中部开始 -->
		<div class="wrapper">
			<!-- 左侧菜单开始 -->
			<jsp:include page="menu.jsp"/>
			<!-- 左侧菜单结束 -->
			<!-- 右侧主体开始 -->
			<div class="page-content">
				<div class="content">
					<!-- 右侧内容框架，更改从这里开始 -->
					<form class="layui-form xbs" action="">
						<div class="layui-form-pane" style="text-align: center;">
							<div class="layui-form-item" style="display: inline-block;">
								<!-- <label class="layui-form-label xbs768">日期范围</label>
                    <div class="layui-input-inline xbs768">
                      <input class="layui-input" placeholder="开始日" id="LAY_demorange_s">
                    </div>
                    <div class="layui-input-inline xbs768">
                      <input class="layui-input" placeholder="截止日" id="LAY_demorange_e">
                    </div>时间选择器 -->
							<!-- 	<div class="layui-input-inline">
									<input type="text" name="username" placeholder="请输入用户名" autocomplete="off" class="layui-input">
								</div> -->
							<!-- 	<div class="layui-input-inline" style="width:80px">
									<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
								</div> -->
							</div>
						</div>
					</form>
					<%--<xblock>--%>
						<%--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon">&#xe640;</i>批量删除</button>--%>
						<%--<button class="layui-btn" onclick="kiss_add('添加事件','kiss-add.html')"><i class="layui-icon">&#xe608;</i>添加</button>--%>
						<%--<span class="x-right" style="line-height:40px">共有数据：88 条</span>--%>
					<%--</xblock>--%>
					<table class="layui-table">
						<thead>
							<tr>
								<th>
									ID
								</th>
								<th>
									公告
								</th>
								<th>
									公告内容
								</th>
								<th>
									操作
								</th>
							</tr>
						</thead>
						<tbody>
						<input type="text" value="${mid}" hidden="hidden">
							<c:forEach items="${elements}" var="item" varStatus="o">
								<tr>
									<td>
										${o.count}
									</td>
									<td>
										${item.name}
									</td>
									<td>
										${item.count}
									</td>
									<td class="td-manage">
										<!-- 还没想清楚到底是详情好还是修改好 -->
										<a title="详情" href="javascript:;" onclick="services_edit('${item.eid}','${mid}')" style="text-decoration:none">
											<i class="layui-icon">&#xe642;</i>
										</a>
										<a title="删除" href="javascript:;" onclick="services_del(this,'${item.eid}')" style="text-decoration:none">
											<i class="layui-icon">&#xe640;</i>
										</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<!-- 右侧内容框架，更改从这里结束 -->
				</div>
			</div>
			<!-- 右侧主体结束 -->
		</div>
		<!-- 中部结束 -->
		<!-- 底部开始 -->
<!-- 		<div class="footer">
			<div class="copyright">Copyright ©2017 x-admin v2.3 All Rights Reserved. 本后台系统由X前端框架提供前端技术支持</div>
		</div> -->
		<!-- 底部结束 -->
		<!-- 背景切换开始 -->
		<div class="bg-changer">
			<div class="swiper-container changer-list">
				<div class="swiper-wrapper">
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/a.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/b.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/c.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/d.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/e.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/f.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/g.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/h.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/i.jpg" alt=""></div>
					<div class="swiper-slide"><img class="item" src="${pageContext.request.contextPath}/static/images/j.jpg" alt=""></div>
					<div class="swiper-slide"><span class="reset">初始化</span></div>
				</div>
			</div>
			<div class="bg-out"></div>
			<div id="changer-set"><i class="iconfont">&#xe696;</i></div>
		</div>
		<!-- 背景切换结束 -->
		<!-- 页面动态效果 -->
		<script>
			/*等级-删除*/
			function services_del(obj, id) {
				layer.confirm('确认要删除吗？', function(index) {
					$.ajax({
                        type: "post",
                        url: "${pageContext.request.contextPath}/delelement.do",
                        data: {
                            sid: id
                        },
                        success: function (s) {
                            if (s.success) {
                                //发异步删除数据
                                $(obj).parents("tr").remove();
                                layer.msg('已删除!', {
                                    icon: 1,
                                    time: 1000
                                });
                                <%--top.location.href = encodeURI("${pageContext.request.contextPath}/main.do?admin=****&url=order");--%>
                            } else {
                                alert(s.msg);
                            }
                        }
                    })
				});
			}
			
			
			// 自己写的
			//修改
			function services_edit(eid,mid){
			    var url = "${pageContext.request.contextPath}/toEditblog.do?eid=" + eid + "&mid="+mid;
				x_admin_show(
				"修改生活公告",
				url,
				"500","300"
				)
				}
				
		</script>
		<script>
			//百度统计可去掉
			var _hmt = _hmt || [];
			(function() {
				var hm = document.createElement("script");
				hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
				var s = document.getElementsByTagName("script")[0];
				s.parentNode.insertBefore(hm, s);
			})();
		</script>
	</body>
</html>
